import VueRouter from 'vue-router';
//导入渲染组件
import home from './component/tabbar/homecontainer.vue';
import member from './component/tabbar/membercontainer.vue';
import cart from './component/tabbar/cartcontainer.vue';
import search from './component/tabbar/searchcontainer.vue';
import newslist from './component/news/newslist.vue';
import newsinfo from './component/news/newsinfo.vue';
import photolist from './component/photos/photolist.vue';
import photoinfo from './component/photos/photoinfo.vue';
import goodslists from './component/goods/GoodsLists.vue';
import GoodsInfo from './component/goods/GoodsInfo.vue';
import GoodsDesc from './component/goods/GoodsDesc.vue';
import GoodsComment from './component/goods/GoodsComment.vue';
//  创建路由对象
var router = new VueRouter({
  routes: [
      { path: '/', redirect: '/home' },
      { path:'/home', component:home},
      { path:'/member', component:member},
      { path:'/cart',component:cart},
      { path:'/search',component:search},
      { path:'/home/newslist',component:newslist},
      { path:'/home/newsinfo/:id',component:newsinfo},
      { path:'/home/photolist',component:photolist},
      { path:'/home/photoinfo/:id',component:photoinfo},
      { path:'/home/goodslists',component:goodslists},
      { path:'/home/goodsinfo/:id', component: GoodsInfo, name: 'goodsinfo' },
      { path: '/home/goodsdesc/:id', component:GoodsDesc, name: 'goodsdesc'  },
      { path: '/home/goodscomment/:id', component: GoodsComment, name: 'goodscomment' }
      
  ],
  linkActiveClass:'mui-active'
})

export default router